<?php

use yii\db\Migration;

/**
 * Handles the creation of table `admin_role`.
 */
class m170331_121458_create_admin_role_table extends Migration
{
    /**
     * @inheritdoc
     */
    public function up()
    {
        $this->createTable('admin_role', [
            'admin_id' => $this->integer(3)->unsigned()->notNull()->defaultValue(0)->comment('管理员ID'),
            'role_id' => $this->integer(3)->unsigned()->notNull()->defaultValue(0)->comment('角色ID'),
        ]);
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('admin_role');
    }
}
